﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StuZaiXiaoInfo.aspx.cs" Inherits="Sagacity.NC.Web.BasicSettings.Student.StuZaiXiaoInfo" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Src="~/Form/TreeCommon.ascx" TagName="TreeFormCommon" TagPrefix="uc1" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../resources/css/main.css" />
    <script type="text/javascript" src="../../resources/JS/ExampleTab.js"></script>    
    <script type="text/javascript">
    
        var loadExample = function(href, id) {
            var tab = ExampleTabs.getComponent(id);

            if (tab) {
                ExampleTabs.setActiveTab(tab);
            } else {
                createExampleTab(id, href);
            }
        }

        var selectionChaged = function(dv, nodes) {
            if (nodes.length > 0) {
                var url = nodes[0].getAttribute("ext:url"),
                    id = nodes[0].getAttribute("ext:id");

                loadExample(url, id);
            }
        }

        var viewClick = function(dv, e) {
            var group = e.getTarget("h2", 3, true);

            if (group) {
                group.up("div").toggleClass("collapsed");
            }
        }
        
         function closeOtherTabs(){
            try{
                tabInfoTabs.closeTab(tabInfoTabs.items.items[1]);
            }catch(e){}
        }
    </script>
</head>
<body>
    <form runat="server" id="form1">
        <!--js方法-->
    <script language="javascript" type="text/javascript">
        var regionId = 0;
        var schoolId = 0;
        //加载学校信息
        function refreshSchoolInfo(obj){
            regionId = obj.id;
            var express = "Region_ID="+obj.id;
            nodeLoadSearch(express);
        }

        /*----打开或折叠处于西方位置的Panel，true，折叠；false，打开------*/
        function openOrCollapseWest(oc) {
            oc ? pnlWest.collapse() : pnlWest.expand();
        }
        
        var  showFunctionName = "treeNodeClick()";
        function treeNodeClick(object){
            schoolId = selectedNodeId;
            document.frames[0].refreshStudentInfo(selectedNodeId,0);            
        }
        
        ///取得参数
        var getParamters = function(){
             var prams = "RegionID="+regionId+"&"+"SchoolID="+schoolId;
             return prams;
        }
    </script>
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    
    <!--配置信息-->
    <asp:HiddenField ID="hidSchoolResourceId" runat="server" Value="171" />
    <asp:HiddenField ID="hidRegionResourceId" runat="server" Value="149" />
    <asp:HiddenField ID="hidSchoolParentColumn" runat="server" Value="PARENTID" />
    <asp:HiddenField ID="hidSchoolCaptionColumn" runat="server" Value="CAPTION"/>
    <asp:HiddenField ID="hidSchoolIDColumn" runat="server" Value="ID"/>
    <asp:HiddenField ID="hidtoolBarPanelId" runat="server" Value="TreePanel" />
    <asp:HiddenField ID="hidRegionParentColumn" runat="server" Value="PARENTID" />
    <asp:HiddenField ID="hidRegionCaptionColumn" runat="server" Value="REGION_NAME"/>
    <asp:HiddenField ID="hidRegionColumn" runat="server" Value="REGION_ID"/>
    <asp:HiddenField ID="hidTableName" runat="server" Value="Region_School_tree" />
    <ext:Store runat="server" ID="cbTreeStore">
        <Reader>
            <ext:JsonReader ReaderID="text">
                <Fields>
                    <ext:RecordField Name="text" />
                    <ext:RecordField Name="value" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Load Handler="load();" />
        </Listeners>
    </ext:Store>
    
    <ext:ViewPort ID="ViewPort1" AllowDomMove="false"  AutoRender="false" runat="server">
        <Body>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <West Collapsible="true" CollapseMode="Mini" Split="true">
                    <ext:Panel ID="pnlWest" runat="server" Header="false" Border="false" Width="240">
                        <Body>
                            <uc1:TreeFormCommon ID="TreeFormCommon1" resourceId="171" runat="server" />
                        </Body>
                    </ext:Panel>
                </West>
                <Center>
                    <ext:TabPanel ID="tabInfoTabs" runat="server" ActiveTabIndex="0" EnableTabScroll="true">
                        <Tabs>
                            <ext:Tab ID="tabInfo" runat="server" Icon="ApplicationViewList" Title="学生信息列表">
                                <AutoLoad NoCache="true" Mode="IFrame" Url="StuZaiXiaoList.aspx" ShowMask="true" MaskMsg="加载学生信息...." >
                                </AutoLoad>
                                <Listeners>
                                    <Activate Handler="javascript:openOrCollapseWest(false);" />
                                    <Deactivate Handler="javascript:openOrCollapseWest(true);" />
                                </Listeners>
                            </ext:Tab>
                        </Tabs>
                        <Plugins>
                            <ext:TabCloseMenu ID="TabCloseMenu1"  CloseTabText="关 闭" CloseOtherTabsText="除此之外全部关闭" runat="server" >
                            </ext:TabCloseMenu>
                        </Plugins>
                    </ext:TabPanel>
                </Center>
            </ext:BorderLayout>
        </Body>
    </ext:ViewPort>
    
    <script type="text/javascript">
         var load=function(){
             TreeFormCommon1_ComboTree1.store = cbTreeStore;
         }
        Ext.onReady(function() {
             TreeFormCommon1_TreePanel.expandAll();
         });
    </script>
    </form>
</body>
</html>